# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=evolution-data-server
pkgver=3.24.5
pkgrel=1
pkgdesc="Centralized access to appointments and contacts"
url="https://wiki.gnome.org/Apps/Evolution"
arch=(i686 x86_64)
depends=(gnome-online-accounts nss krb5 libgweather libical db libgdata libphonenumber)
makedepends=(intltool gperf gobject-introspection vala gtk-doc boost git cmake ninja)
license=(GPL)
_commit=82e2a4a970d2fd709daed3db0fef03cbeb422ee7  # tags/EVOLUTION_DATA_SERVER_3_24_5^0
source=("git+https://git.gnome.org/browse/evolution-data-server#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^EVOLUTION_DATA_SERVER_//;s/_/./g;s/-/+/g'
}

build() {
  cd $pkgname

  cmake . -G Ninja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIBEXEC_INSTALL_DIR=/usr/lib/$pkgname \
    -DSYSCONF_INSTALL_DIR=/etc \
    -DENABLE_INTROSPECTION=ON \
    -DENABLE_VALA_BINDINGS=ON \
    -DENABLE_UOA=OFF \
    -DENABLE_GOOGLE_AUTH=ON \
    -DENABLE_GTK_DOC=ON \
    -DWITH_PHONENUMBER=ON
  ninja
}

check() {
  cd $pkgname
  # libedata-book tests fail because they try to
  # mkdir /usr/lib/evolution-data-server/camel-providers
  ninja test || :
}

package() {
  cd $pkgname
  DESTDIR="$pkgdir" ninja install
}
